﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/Profile.Master" AutoEventWireup="true"
    CodeBehind="MessageIdeas.aspx.cs" Inherits="DatingWebSite.Pages.MessageIdeas"
    Title="Untitled Page" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div id="center_column_wide">
        <div id="prof_top_nav">
            <div id="prof_top_nav_left">
                <div class="subtab">
                </div>
                <div class="subtab_mid">
                    <a href="Profile.aspx" class="alertLink">Back to My Profile</a>
                </div>
                <div class="subtab_end">
                </div>
            </div>
        </div>
        <div id="common_topper_wide">
            Message Ideas</div>
        <div id="common_body">

            <script type="text/javascript" language="javascript">
			function ChechCheckboxes(that) 			{          var checkBoxList = document.getElementById ('<%=chkBoxList.ClientID%>');
            var checkBoxes = checkBoxList.getElementsByTagName("input");
								var checkedCounter = 0;
				for (var i=0;i<checkBoxes.length;i++) {
					if (document.forms.chkBoxList[i].checked) {
						checkedCounter++
					}										//				
				if (checkedCounter > 4) {
					that.checked=false;
										message.innerHTML='<a href="javascript:DeselectAll();">Deselect All</a> &nbsp; You can only pick 4 message starters.';
					return false;
				} else {
					return true;
				}
			}
            function Test()            {                            	var checkBoxCount = 0;     

        var elements = document.getElementById('<%=chkBoxList.ClientID%>');
        

        for(i=0; i<elements.length;i++)

        {

        if(elements[i].checked) 

        checkBoxCount++;

        }  

        if (checkBoxCount == 0)
               {
                alert("Please choose atleast one");
              return false;
              }					
				                        }
			function DeselectAll() {			   
			    var checkBoxList=document.getElementById('<%=chkBoxList.ClientID%>');
                var checkBoxes = checkBoxList.getElementsByTagName("input");
				for (var i=0;i<checkBoxes.length;i++) {
					document.forms.chkBoxList[i].checked = false;				
				}
			}
            </script>

            <form method="post" name="form">
            <p align="center">
                This is a great way to help you learn about those who contact you. Choose up to
                4 questions that people who are interested may answer when they send you a message.</p>
            <table width="90%" border="0" align="center" cellspacing="1" id="message_ideas">
                <asp:CheckBoxList ID="chkBoxList" name="chkMessage" runat="server">
                   
                </asp:CheckBoxList>
                <tr>
                   
                </tr>
            </table>
            <br />
            <input type="hidden" name="action" value="preview_messageIdeas">
            <p align="center">
                <asp:Button runat="server" Text="Save" ID="btnSubmit" OnClick="btnSubmit_Click" />
            </form>
        </div>
        <div id="common_bottom_wide">
        </div>
    </div>
    </div> </div> </div>
</asp:Content>
